package com.soushin.chinachess.module;

import java.io.IOException;
import java.io.InputStream;

import com.soushin.chinachess.R;
import com.soushin.chinachess.R.layout;
import com.soushin.chinachess.base.BaseActivity;
import com.soushin.chinachess.widget.game.GameConfig;
import com.soushin.chinachess.widget.xqwlight.Position;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
/**
 * 开始游戏  退出游戏 
 * 故事的一切从这里开始
 * @author Administrator
 *
 */
public class FirstActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_first);
		initData();
	}

	private void initData() {
		//数据初始化
		InputStream is;
		try {
			is = getAssets().open(GameConfig.DAT_ASSETS_PATH);
			boolean result = Position.loadBook(is);
			Log.e("加载结果",result+"");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void btnStart(View v) {
		goTo(MainActivity.class);
		finish();
	};

	public void btnExit(View v) {
		finish();
		System.exit(0);
	};
}
